{extend name="app/shop/view/base.html"/}

{block name="resources"}
<style>
    .layui-table .layui-btn{
      justify-content: flex-end;
      padding-right: 0px;
      text-align: right;
    }
    .name{
      display: flex;
      align-content: center;
    }
    .name img{
      max-width: inherit;
      width: 60px;
      height: 60px;
      margin-right: 10px;
    }
</style>
{/block}

{block name="main"}
<div class="layui-form card-brief" lay-filter="storeform">
    <div class="layui-card">
      <div class="layui-elem-quote">基本信息</div>
      <div class="layui-row">
        <div class="layui-col-md3">
          <div class="layui-form-item">
            <label class="layui-form-label">制单人：</label>
            <div class="layui-input-block">{$document_detail.operater_name}</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">关联单据：</label>
            <div class="layui-input-block">{$document_detail.type_name}</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">制单时间：</label>
            <div class="layui-input-block">{$document_detail.create_time}</div>
          </div>
        </div>

        <div class="layui-col-md3">

          <div class="layui-form-item">
            <label class="layui-form-label">状态：</label>
            <div class="layui-input-block">{$document_detail.status_data.name}</div>
          </div>
          {if $document_detail.verifier_name }
          <div class="layui-form-item">
            <label class="layui-form-label">审核人：</label>
            <div class="layui-input-block">{$document_detail.verifier_name}</div>
          </div>
          {/if}
          {if $document_detail.audit_time }
          <div class="layui-form-item">
            <label class="layui-form-label">审核时间：</label>
            <div class="layui-input-block">{$document_detail.audit_time}</div>
          </div>
          {/if}
          {if $document_detail.status == -1}
          <div class="layui-form-item">
            <label class="layui-form-label">拒绝理由：</label>
            <div class="layui-input-block">{$document_detail.refuse_reason}</div>
          </div>
          {/if}
        </div>
  
        <div class="layui-col-md3">
          <div class="layui-form-item">
            <label class="layui-form-label">出库门店：</label>
            <div class="layui-input-block">{$document_detail.store_name}</div>
          </div>
        </div>
      </div>
    </div>
      <div class="layui-card">
        <div class="layui-elem-quote">商品明细</div>
        <table class="layui-table order_goods_list" lay-filter="order_goods" lay-skin="line">
          <colgroup>
            <col width="30%" />
            <col width="10%" />
            <col width="10%" />
            <col width="10%" />
            <col width="10%" />
            <col width="10%" />
          </colgroup>
          <thead>
            <tr>
              <th>商品名称/条形码</th>
              <th>规格</th>
              <th>单位</th>
              <th>数量</th>
              <th>单价(元)</th>
              <th>金额(元)</th>
            </tr>
          </thead>
        </table>
        <table class="layui-table order_goods_list order_goods_list-bottom" lay-filter="order_goods_list" lay-skin="line">
          <colgroup>
            <col width="30%" />
            <col width="10%" />
            <col width="10%" />
            <col width="10%" />
            <col width="10%" />
            <col width="10%" />
          </colgroup>
          <tbody>
              {foreach $document_detail.goods_sku_list_array as $k => $v}
              <tr class="table-tr">
                  <td class="name">
                    <img src="{:img($v.goods_sku_img,'small')}" alt="">
                    <span>{$v.goods_sku_name}</span>
                  </td>
                  <td>{$v.goods_sku_spec}</td>
                  <td>{$v.goods_unit}</td>
                  <td>{$v.goods_num}</td>
                  <td>{$v.goods_price}</td>
                  <td>{$v.goods_sum}</td>
              </tr>
              {/foreach}
          </tbody>
        </table>
        <label style="display: flex;justify-content: flex-end;padding-right: 13px;">合计：共{$document_detail.goods_count}种商品{$document_detail.goods_price}件,合计金额：
          <span style="color: #ff0000;">{$document_detail.goods_total_price}</span></label>
      </div>
    </div>
{/block}
{block name="script"}
{/block}